﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin.master" AutoEventWireup="true" CodeFile="DiChuyenNhanVien.aspx.cs" Inherits="DiChuyenNhanVien" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:UpdatePanel ID="up1" runat="server">
        <ContentTemplate>
            <div class="panel panel-success margin">
                <div class="panel-heading">
                    <h3 class="panel-title">
                        Thiết lập di chuyển nhân viên</h3>
                </div>
                <div class="panel-body">
                    <table width="100%">
                        <tr>
                            
                            <td>
                                <span style="margin-left: 5px;">Nhân viên</span><br />
                                <asp:DropDownList runat="server" CssClass="form-control width98" ID="dlNhanVien"
                                    DataValueField="IDs" DataTextField="HoTen" >
                                </asp:DropDownList>
                                <asp:RequiredFieldValidator ValidationGroup="Them" ID="RequiredFieldValidator1" runat="server"
                                    ControlToValidate="dlNhanVien" ErrorMessage="Chọn nhân viên" Display="None" Text="*"></asp:RequiredFieldValidator>
                            </td>
                            <td>
                                <span style="margin-left: 5px;">Bộ phận</span><br />
                                <asp:DropDownList runat="server" CssClass="form-control width98" ID="dlBoPhan" DataTextField="TenBoPhan"
                                    DataValueField="IDs">
                                </asp:DropDownList>
                                <asp:RequiredFieldValidator ValidationGroup="Them" ID="RequiredFieldValidator3" runat="server"
                                    ControlToValidate="dlBoPhan" ErrorMessage="Chọn bộ phận" Display="None" Text="*"></asp:RequiredFieldValidator>
                            </td>
                            <td>
                                <span style="margin-left: 5px;">Chức vụ</span><br />
                                <asp:DropDownList runat="server" CssClass="form-control width98" ID="dlChucVu" DataTextField="TenChucVu"
                                    DataValueField="IDs">
                                </asp:DropDownList>
                                <asp:RequiredFieldValidator ValidationGroup="Them" ID="RequiredFieldValidator4" runat="server"
                                    ControlToValidate="dlChucVu" ErrorMessage="Chọn chức vụ" Display="None" Text="*"></asp:RequiredFieldValidator>
                            </td>
                           <td>
                                Từ ngày<br />
                                <asp:TextBox runat="server" CssClass="form-control with98" ID="txttungay1">
                                </asp:TextBox>
                                <cc1:CalendarExtender PopupPosition="BottomRight" ID="CalendarExtender1" runat="server"
                                    TargetControlID="txttungay1" Format="dd/MM/yyyy">
                                </cc1:CalendarExtender>
                                <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender2" runat="server" FilterType="Custom,Numbers"
                                    TargetControlID="txttungay1" ValidChars="/" />
                            </td>
                            <td>
                                Đến ngày<br />
                                <asp:TextBox runat="server" CssClass="form-control with98" ID="txtdenngay1">
                                </asp:TextBox>
                                <cc1:CalendarExtender PopupPosition="BottomRight" ID="CalendarExtender2" runat="server"
                                    TargetControlID="txtdenngay1" Format="dd/MM/yyyy">
                                </cc1:CalendarExtender>
                                <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender3" runat="server" FilterType="Custom,Numbers"
                                    TargetControlID="txtdenngay1" ValidChars="/" />
                            </td>
                        </tr>
                        <tr>
                            <td colspan="8">
                                <asp:Button ID="btnSave" ValidationGroup="Them" runat="server" Style="margin-left: 5px;
                                    height: 37px;" Text="Lưu lại" CssClass="btn btn-primary" OnClick="btnSave_Click" />
                                <asp:Button ID="btncapnhat" runat="server" Text="Cập nhật" CssClass="btn btn-info" ValidationGroup="Them"
                                    OnClick="btncapnhat_Click" Visible="false" />
                                <asp:Button ID="btnCancel" runat="server" Text="Nhập mới" CssClass="btn btn-warning"
                                    OnClick="btnCancel_Click" />
                            </td>
                        </tr>
                    </table>
                    <asp:ValidationSummary ID="ValidationSummary1" HeaderText="Bạn phải nhập các trường sau:"
                        ShowMessageBox="true" ValidationGroup="Them" ShowSummary="false" EnableClientScript="true"
                        runat="server" />
                </div>
            </div>
            <div style="margin: 5px;">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <b>Danh nhân viên di chuyển</b></div>
                    <div style="margin-bottom: 5px;">
                        
                        
                        <asp:DropDownList runat="server" CssClass="form-control width98" ID="dlNhanVienLoc"
                            Width="200px"  DataValueField="IDs" DataTextField="HoTen">
                        </asp:DropDownList>
                        <asp:DropDownList runat="server" CssClass="form-control width98" ID="dlBoPhanLoc"
                            Width="200px" Visible="false" DataValueField="IDs" DataTextField="TenBoPhan">
                        </asp:DropDownList>
                        <asp:DropDownList runat="server" CssClass="form-control width98" ID="dlChucVuLoc"
                            Width="200px" Visible="false" DataValueField="IDs" DataTextField="TenChucVu">
                        </asp:DropDownList>
                        <asp:Button ID="btnTimKiem" runat="server" Text="Xem" CssClass="btn btn-primary"
                            OnClick="btnTimKiem_Click" />
                            
                    </div>
                    <div style="width: 100%; margin-top: 0px;" class="wrapper">
                        <asp:GridView ID="GV" runat="server" AutoGenerateColumns="false" BackColor="White"
                            BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="1" EmptyDataText="Không có dữ liệu nào"
                            EnableModelValidation="True" ShowFooter="false" CssClass="form-control withall"
                            Width="99%" OnRowCommand="GV_RowCommand" >
                            <Columns>
                                <asp:TemplateField HeaderText="Xóa" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="50px"
                                    ItemStyle-Width="50px">
                                    <ItemTemplate>
                                        <asp:ImageButton ID="lbXoa" runat="server" Width="20px" Height="20px" ImageUrl="~/img/delete-24.png"
                                            OnClientClick="return confirm('Bạn chắc chắn muốn xóa ?')" CommandArgument='<%#Eval("IDs")%>'
                                            Text="Xóa" CommandName="Del" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Sửa" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="50px"
                                    ItemStyle-Width="50px">
                                    <ItemTemplate>
                                        <asp:ImageButton ID="lbSua" runat="server" Width="15px" Height="15px" ImageUrl="~/img/edit.ico"
                                            CommandArgument='<%#Eval("IDs")%>' Text="Sửa" CommandName="Select" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                               
                                <asp:BoundField DataField="hoten" ItemStyle-CssClass="padding" HeaderText="Nhân viên" />
                                <asp:BoundField DataField="tenBoPhan" ItemStyle-CssClass="padding" HeaderText="Bộ phận" />
                                <asp:BoundField DataField="tenChucVu" ItemStyle-CssClass="padding" HeaderText="Chức vụ" />
                                <asp:BoundField DataField="tungay" ItemStyle-CssClass="padding" HeaderText="Từ ngày" />
                                <asp:BoundField DataField="denngay" ItemStyle-CssClass="padding" HeaderText="Đến ngày" />
                              
                            </Columns>
                            <FooterStyle BackColor="White" ForeColor="#000066" Font-Bold="True" HorizontalAlign="Left" />
                            <HeaderStyle BackColor="White" Font-Bold="True" ForeColor="Black" Height="30px" HorizontalAlign="Center" />
                            <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                            <RowStyle BackColor="White" ForeColor="#000066" Height="30px" />
                            <SelectedRowStyle BackColor="Lavender" Font-Bold="false" />
                        </asp:GridView>
                        
                    </div>
                </div>
                <asp:HiddenField ID="hdID" runat="server" />
            </div>
        </ContentTemplate>
        <Triggers>
         
        </Triggers>
    </asp:UpdatePanel>
</asp:Content>


